<!DOCTYPE html>
<html>
<head>
	<title>3-6 Vue中的样式绑定2</title>
	<style type="text/css">
		.actived{
			color: red
		}
		.activedOne{

		}
	</style>
	<script type="text/javascript" src="../../vue.js"></script>
</head>
<body>
	<div id='root'>
		<!-- 
			方式一:给当前标签绑定上一个style:
			1.v-bind:style="styleObj" 这种写法其实就相当于 var style = new styleObj
			2.[]数组形式  
		 -->
		<!-- <div v-on:click="clickColor" 
			 v-bind:style="styleObj"  
		> -->
		<div v-on:click="clickColor" 
			 v-bind:style="[styleObj,{fontSize:'50px'}]" 
		>
			hello world
		</div>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
			el:'#root',
			data:{
				styleObj:{
					color:''
				}
			},
			methods:{
				clickColor:function(){
					this.styleObj.color = this.styleObj.color === ''?'red':''//①
					//② 
				}
			}
		});
	</script>
</body>
</html>